package com.leo.springbootmultithreadbasic.async.withthreadpool;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Leo
 * @version V1.0
 */
@RestController("TestController2")
public class TestController {

    private static final Logger logger = LoggerFactory.getLogger(TestController.class);

    @Resource
    private AsyncTaskService asyncTaskService2;

    /**
     * 带自定义线程池
     */
    @GetMapping("/testAsync2")
    public void test() {
        asyncTaskService2.test1();

        logger.info("我是主线程执行的任务。我不会等待子任务异步执行的结果。");
    }


}
